<template>
  <div>
      <table>
        <tbody>
        <tr>
          <td >
            用户名
          </td>
          <td>
            {{ userName }}
          </td>
        </tr>
        <tr class="info-color-dark">
          <td >
            自我介绍
          </td>
          <td class="info-color-dark">
            {{ signature }}
          </td>
        </tr>
        <tr class="info-color-dark">
          <td >
            邮箱
          </td>
          <td>
            {{ email }}
          </td>
        </tr>
        <tr class="info-color-dark">
          <td >
            用户等级
          </td>
          <td>
            {{ identity }}
          </td>
        </tr>
        <tr class="info-color-dark">
          <td >
            其他信息
          </td>
          <td>
            {{ information }}
          </td>
        </tr>
        </tbody>
      </table>
  </div>
</template>

<script>
export default {
  name: "Sidebar",
  data(){
    return {
      userName:"游客",
      signature:"请登录或注册",
      email:"请登录或注册",
      information:"请登录或注册",
      identity:"游客"
    }
  },
  created() {
    let user_id=sessionStorage.getItem('id');
    let form={
      user_id:user_id
    };
    this.$http.post('http://localhost:8081/getInfo',form)
        .then(res => res.json())
        .then(res=>{
          this.userName=res.username;
          this.signature=res.signature;
          this.email=res.email;
          this.information=res.information;
          this.identity=res.identity;
        });
  }
}
</script>

<style scoped>

</style>